	$(function() {
		f_initGrid(contextPath + "/HwglAction?control=getSpList", null);
		});
	var manager, g;
	function f_initGrid(dataUrl, postParams)
	{ 
		g = manager = $("#maingrid").ligerGrid({
			columns: [
			{ display: '型号', name: 'xh',editor: { type: 'text' }},
			{ display: '类型',  name: 'splx',editor: { type: 'text' }},
			{ display: '名称',  name: 'mc',editor: { type: 'text' }},
			{ display: '数量',  name: 'sl',editor: { type: 'text' }},
			{ display: '厂家',  name: 'cj',editor: { type: 'text' }},
			{ display: '进价',  name: 'jj',editor: { type: 'text' }},
			{ display: '批发价',  name: 'pfj',editor: { type: 'text' }},
			{ display: '零售价',  name: 'lsj',editor: { type: 'text' }},
			{ display: '录入时间',  name: 'lrsj',editor: { type: 'text' },render:function(value){
				return formatDate(value.lrsj,"yyyy-MM-dd HH:mm:ss");
			}}
			],
			enabledEdit: false, height: '95%', checkbox:true,rownumbers:true,
			parms:postParams,
			url :dataUrl,
			width: '100%'
		});   
	}
	
	function getSelected()
	{ 
		var row = manager.getSelectedRow();
		if (!row) { 
			alert('请选择行');
			return; 
		}
		
		return row;
	}
	function getData()
	{ 
		return manager.getData();
	} 